package com.yunhe.tianhe.rentcars.controller.system;

import com.yunhe.tianhe.commons.dto.Pageable;
import com.yunhe.tianhe.rentcars.dto.JSONResponse;
import com.yunhe.tianhe.rentcars.entity.system.BusiLog;
import com.yunhe.tianhe.rentcars.service.system.BusiLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

/**
 * # @Author: 贾波
 * # @Time: 2017/11/29
 * # Description:
 */
@Controller
@RequestMapping("/busiLog")
public class BusiLogController {
    @Autowired
    private BusiLogService busiLogService;
    @RequestMapping
    public String list(){
        return "/system/busiLog/list";
    }

    @RequestMapping("/listData")
    @ResponseBody
    public Pageable<BusiLog> listData(Long offset, Long limit, String busiName, String busiType, @DateTimeFormat(pattern = "yyyy-MM-dd") Date start, @DateTimeFormat(pattern = "yyyy-MM-dd") Date end){
      return busiLogService.findPageList(offset, limit, busiName, busiType, start, end);
    }
}
